#ifndef SERVICEDEFINE_H
#define SERVICEDEFINE_H
#include <grpc++/grpc++.h>
#include "service.grpc.pb.h"
#include "../cpp-pool/ObjectPool.h"
//#include "../GitStoreMeta/Config.h"
//using namespace GitStoreGrpc;
namespace gitstore {
class CObjectController;
class CDatasetController;
// Logic and data behind the server's behavior.
class GitStoreGrpcServiceImpl final : public GitStoreGrpc::GitStoreGrpcService::Service {
    using GitStoreObjectControllerPool = ObjectPool<CObjectController, void>;
    using GitStoreDatasetControllerPool = ObjectPool<CDatasetController, void>;
public:
    GitStoreGrpcServiceImpl();
    virtual ~GitStoreGrpcServiceImpl() override;
    virtual grpc::Status ListObject(grpc::ServerContext* context, const GitStoreGrpc::RequestListObject* request, GitStoreGrpc::ResponseListObject* response) override;
    virtual grpc::Status CreateObject(grpc::ServerContext* context, const GitStoreGrpc::RequestCreateObject* request, GitStoreGrpc::ResponseCreateObject* response) override;
    virtual grpc::Status GetObject(grpc::ServerContext* context, const GitStoreGrpc::RequestGetObject* request, GitStoreGrpc::ResponseGetObject* response) override;
    virtual grpc::Status EditObject(grpc::ServerContext* context, const GitStoreGrpc::RequestEditObject* request, GitStoreGrpc::ResponseEditObject* response) override;
    virtual grpc::Status ListObjectBranches(grpc::ServerContext* context, const GitStoreGrpc::RequestListObjectBranches* request, GitStoreGrpc::ResponseListObjectBranches* response) override;
    virtual grpc::Status ListObjectNodes(grpc::ServerContext* context, const GitStoreGrpc::RequestListObjectNodes* request, GitStoreGrpc::ResponseListObjectNodes* response) override;
    virtual grpc::Status ListBranchNodes(grpc::ServerContext* context, const GitStoreGrpc::RequestListBranchNodes* request, GitStoreGrpc::ResponseListBranchNodes* response) override;
    virtual grpc::Status GetValueByBranch(grpc::ServerContext* context, const GitStoreGrpc::RequestGetValueByBranch* request, GitStoreGrpc::ResponseGetValueByBranch* response) override;
    virtual grpc::Status GetValueByVersion(grpc::ServerContext* context, const GitStoreGrpc::RequestGetValueByVersion* request, GitStoreGrpc::ResponseGetValueByVersion* response) override;
    virtual grpc::Status PutValue(grpc::ServerContext* context, const GitStoreGrpc::RequestPutValue* request, GitStoreGrpc::ResponsePutValue* response) override;
    virtual grpc::Status BranchObject(grpc::ServerContext* context, const GitStoreGrpc::RequestBranchObject* request, GitStoreGrpc::ResponseBranchObject* response) override;
    virtual grpc::Status GetBranch(grpc::ServerContext* context, const GitStoreGrpc::RequestGetBranch* request, GitStoreGrpc::ResponseGetBranch* response) override;
    virtual grpc::Status EditBranch(grpc::ServerContext* context, const GitStoreGrpc::RequestEditBranch* request, GitStoreGrpc::ResponseEditBranch* response) override;
    virtual grpc::Status GetNode(grpc::ServerContext* context, const GitStoreGrpc::RequestGetNode* request, GitStoreGrpc::ResponseGetNode* response) override;
    virtual grpc::Status EditNode(grpc::ServerContext* context, const GitStoreGrpc::RequestEditNode* request, GitStoreGrpc::ResponseEditNode* response) override;
    virtual grpc::Status DiffObjectVersion(grpc::ServerContext* context, const GitStoreGrpc::RequestDiffObjectVersion* request, GitStoreGrpc::ResponseDiffObjectVersion* response) override;
    virtual grpc::Status DiffObjectBranch(grpc::ServerContext* context, const GitStoreGrpc::RequestDiffObjectBranch* request, GitStoreGrpc::ResponseDiffObjectBranch* response) override;
    virtual grpc::Status MergeVersion(grpc::ServerContext* context, const GitStoreGrpc::RequestMergeVersion* request, GitStoreGrpc::ResponseMergeVersion* response) override;
    virtual grpc::Status MergeBranch(grpc::ServerContext* context, const GitStoreGrpc::RequestMergeBranch* request, GitStoreGrpc::ResponseMergeBranch* response) override;

    virtual grpc::Status ListDataset(grpc::ServerContext* context, const GitStoreGrpc::RequestListDataset* request, GitStoreGrpc::ResponseListDataset* response) override;
    virtual grpc::Status CreateDataset(grpc::ServerContext* context, const GitStoreGrpc::RequestCreateDataset* request, GitStoreGrpc::ResponseCreateDataset* response) override;
    virtual grpc::Status ListDatasetBranches(grpc::ServerContext* context, const GitStoreGrpc::RequestListDatasetBranches* request, GitStoreGrpc::ResponseListDatasetBranches* response) override;
    virtual grpc::Status ListDatasetKeysByBranch(grpc::ServerContext* context, const GitStoreGrpc::RequestListDatasetKeysByBranch* request, GitStoreGrpc::ResponseListDatasetKeysByBranch* response) override;
    virtual grpc::Status ListDatasetKeysByVersion(grpc::ServerContext* context, const GitStoreGrpc::RequestListDatasetKeysByVersion* request, GitStoreGrpc::ResponseListDatasetKeysByVersion* response) override;
    virtual grpc::Status BranchDataset(grpc::ServerContext* context, const GitStoreGrpc::RequestBranchDataset* request, GitStoreGrpc::ResponseBranchDataset* response) override;
    virtual grpc::Status PutKey(grpc::ServerContext* context, const GitStoreGrpc::RequestPutKey* request, GitStoreGrpc::ResponsePutKey* response) override;
    virtual grpc::Status GetKeyByBranch(grpc::ServerContext* context, const GitStoreGrpc::RequestGetKeyByBranch* request, GitStoreGrpc::ResponseGetKeyByBranch* response) override;
    virtual grpc::Status GetKeyByVersion(grpc::ServerContext* context, const GitStoreGrpc::RequestGetKeyByVersion* request, GitStoreGrpc::ResponseGetKeyByVersion* response) override;
    virtual grpc::Status DiffKeysByBranch(grpc::ServerContext* context, const GitStoreGrpc::RequestDiffKeysByBranch* request, GitStoreGrpc::ResponseDiffKeysByBranch* response) override;
    virtual grpc::Status DiffKeysByVersion(grpc::ServerContext* context, const GitStoreGrpc::RequestDiffKeysByVersion* request, GitStoreGrpc::ResponseDiffKeysByVersion* response) override;
};



}
#endif // SERVICEDEFINE_H
